/**
 * 
 */
package net.sisgac.despacho_mercaderia.model.dao.jpa;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.Query;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


import net.sisgac.cliente.model.Cliente;
import net.sisgac.despacho_mercaderia.model.GuiaRemision;
import net.sisgac.despacho_mercaderia.model.OrdenServicio;
import net.sisgac.despacho_mercaderia.model.Transportista;
import net.sisgac.despacho_mercaderia.model.dao.TransportistaDAO;

/**
 * @author Luis Yarleque
 *
 */

@SuppressWarnings("unchecked")
public class JPATransportistaDAO implements TransportistaDAO{

	private EntityManager em;
	private Log log = LogFactory.getLog(getClass());
	
	public JPATransportistaDAO(EntityManager em){
		this.em=em;
	}

	@Override
	public Transportista findbyId(int id) {
		Query query=em.createQuery("Select o From Transportista o where o.idtransportista=?1");
		query.setParameter(1, id);
		return (Transportista)query.getSingleResult();	
	}
	
	

}
